package com.example.springboot.mapper;

import com.example.springboot.entity.BookReservation;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;


@Mapper
public interface BookReservationMapper{

    /**
     * 根据id修改预约信息
     */
    int updateReservation(BookReservation reservation);

    /**
     * 新增预约信息
     */
    void save(BookReservation bookReservation);

    /**
     * 跟据用户id查询预约信息
     * @param userId
     * @return
     */
    List<BookReservation> findByUserId(Long userId);
/**
     * 跟据图书id查询预约信息
     * @param bookId
     * @return
     */
    List<BookReservation> findByBookId(Long bookId);

    /**
     * 根据用户id和状态查询预约信息
     * @param userId
     * @param status
     * @return
     */
    List<BookReservation> getReservationsByUserIdAndStatus(Long userId, String status);

    /**
     * 根据状态查询预约信息
     * @param status
     * @return
     */
    List<BookReservation> getReservationsByStatus(String status);
}




